﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace HospitalSystem
{
    public partial class Inventor : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {


            String ShowValue = (string)Session["idlogin"];
            UserLabel.Text = ShowValue;
            int RC = (int)Session["userrolecount"];
            if (RC > 1)
            {
                SwapRole.Visible = true;
            }
            else
            {
                SwapRole.Visible = false;
            }




            if (!IsPostBack)
            {

                String ShowValue2 = (string)Session["find"];
                find.Text = ShowValue2;


            }






        }








        protected void Button_find_Click(object sender, EventArgs e)
        {
            Session["CID"] = null;
            Session["LastName"] = null;
            Session["FirstName"] = null;
            Session["CaseNo"] = null;
            Session["PSNumber01"] = null;
            Session["find"] = null;

            Session["find"] = find.Text;

            Response.Redirect("~/findchild.aspx");
        }

        protected void SwapRole_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("~/Admin/GatewayPage.aspx");
        }

        protected void AccountSetting_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("~/Admin/UIDManagement.aspx");
        }

        protected void logout_Click(object sender, ImageClickEventArgs e)
        {
            FormsAuthentication.SignOut();

            // Roles.DeleteCookie();
            Session.Clear();
            Response.Redirect("~/Admin/Login.aspx");
        }


        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            FormsAuthentication.SignOut();

            // Roles.DeleteCookie();
            Session.Clear();
            Response.Redirect("~/Admin/Login.aspx");
        }
    }
}